import { withRouter } from 'next/router';
// 组件
import Main from '@/pages_components/order/Main';

const Order = function ({ query, fullPath }) {
    
    const { order: [goodsId] } = query;

    return (
        <Main
            target="/ticket"
            routes={[
                { name: '景点门票', url: '/ticket' }, 
                { name: '门票详情', url: `/ticket/${goodsId}.html` }, 
                { name: '门票预订', url: fullPath }
            ]}
            query={query}
        />
    )
}

Order.getInitialProps = async (ctx) => {
    if (ctx) {
        return { query: ctx.query, fullPath: ctx.asPath }
    }
    return {}
}

export default withRouter(Order)

